import cornerstone from 'cornerstone-core';
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'
import dicomParser from 'dicom-parser';
export function configureCornerstone() {
    // 配置图像加载器
    cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
    cornerstoneWADOImageLoader.external.dicomParser = dicomParser;

    // 配置Web Worker（可选）
    cornerstoneWADOImageLoader.webWorkerManager.initialize({
        maxWebWorkers: navigator.hardwareConcurrency || 4,
        startWebWorkersOnDemand: true
    });

    // 注册常用Loader
    cornerstoneWADOImageLoader.configure({
        beforeSend: function (xhr) {
            // 可添加请求头等配置
        }
    });
}